package com.heima.wemedia.controller;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.WmNewsDto;
import com.heima.model.common.dtos.WmNewsPageReqDto;
import com.heima.wemedia.service.WmNewsService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 自媒体文章表(WmNews)表控制层
 *
 * @author makejava
 * @since 2022-04-12 15:48:47
 */
@RestController
@RequestMapping("/api/v1/news")
public class WmNewsController {
    /**
     * 服务对象
     */
    @Resource
    private WmNewsService wmNewsService;

    @PostMapping("/submit")
    public ResponseResult submitNews(@RequestBody WmNewsDto newsDto){
    return wmNewsService.submitNews(newsDto);
}

   @PostMapping("/list")
    public ResponseResult selectList(@RequestBody WmNewsPageReqDto page){
      return wmNewsService.lsit(page);
   }

}

